<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                 <button type="button"  class="btn btn-purple btn-sm" onclick='pri()'>
                     <span class="ace-icon fa fa-print icon-on-right bigger-110"></span>
                    		 打印全部
                 </button>
                 <button type="button"  class="btn btn-purple btn-sm pri" onclick='preview(1)'>
                     <span class="ace-icon fa fa-print icon-on-right bigger-110" ></span>
                    		 打印本页
                 </button>
                 <!--startprint1-->
                <div class="cf">
                           <h2 class=" text-center">幼儿园进账详情 </h2>
                 </div>
                 <div>
                           <h5>幼儿园名称：{$data[0]['m_name']}</h5>
                           <h5>时&nbsp;&nbsp;&nbsp;&nbsp;间&nbsp;&nbsp;&nbsp;&nbsp;段：{$dateS}&nbsp;至&nbsp;{$dateE}</h5>
                 </div>
                 <div class="space-4"></div>
                 
                    <div class="space-4"></div>
                      <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户名称</th>
                                <th>报名人名称</th>
                                <th>报名学校</th>
                                <th>报名班级</th>
                                <th>报名金额</th>
                                <th>是否支付</th>
                                <th>报名时间</th>
                            </tr>
                            </thead>
                            <tbody>

                            <?php if($data){
                                foreach($data as $k=>$val){ ?>
                                 <tr>
                                     <td><?php echo $k+1?></td>
                                     <td><?php echo $val['u_name']?></td>
                                     <td><?php echo $val['b_name']?></td>
                                     <td><?php echo $val['m_name']?></td>
                                     <td><?php echo $val['c_name']?></td>
                                     <td><?php echo $val['price']?></td>
                                     <td><if condition=" $val['is_pay'] eq 1 ">已支付<else/>未支付</if></td>
                                     <td><?php echo $val['add_time']?></td>
                                </tr>
                            </foreach>
                            <?php }}else{echo "<tr align='center'><td colspan='9'>没有报名记录！</td></tr>";}?>
                            </tbody>
                        </table>
                    {$page}
                    <!--endprint1-->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div>
</div><!-- /.main-content -->
<include file="Public/footer"/>
<include file="Public/footerjs"/>
<script src="__PUBLIC__/layer/layer.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">
/* 打印全部 */
function pri(){
	 var dateS = '{$dateS}';
	 var dateE = '{$dateE}';
	 var sc_id ='{$data[0]['sc_id']}';
	 var param = '/type/2';
	 if(dateS){
	        param += '/dateS/'+dateS;
	        if(dateE ==''){
	        	alert('参数错误，请刷新页面');
	        	return false;
	        }else{
	        	param += '/dateE/'+dateE;
	        }
	    }
	 if(sc_id){
		 param += '/sc_id/'+sc_id;
	 }else{
		 alert('参数错误，请刷新页面');
		 return false;
	 }
    location.href="__APP__/Admin/Financial/detail"+param+".html";
}
/* 打印当前页 */
function preview(oper) {
	if (oper < 10) {
	bdhtml = window.document.body.innerHTML;//获取当前页的html代码 
	sprnstr = "<!--startprint" + oper + "-->";//设置打印开始区域 
	eprnstr = "<!--endprint" + oper + "-->";//设置打印结束区域 
	prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html 
	prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html 
	window.document.body.innerHTML = prnhtml; 
	window.print(); 
	window.document.body.innerHTML = bdhtml; 
	} else { 
	window.print(); 
	}
}
    $(".del").click(function () {
            var url = $(this).attr('val');
        //alert(url);
        //return false;
            bootbox.confirm({
                title: "系统提示",
                message: "确定要删除该报名记录?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
    function answer(user_id,uid,id){
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['420px', '240px'], //宽高
            content: '<form><textarea rows="5" cols="54" id="content">请输入回复内容....</textarea><button type="button" style="margin-left:175px;" onclick="huifu('+user_id+','+uid+','+id+')" class="btn btn-default navbar-btn">回复评论</button></form>'
          });

    }
    function huifu(user_id,uid,id){
        var content = $('#content').val();
        $.ajax({
            url:"{:U('answer')}",
            type:"get",
            data:{user_id:user_id,uid:uid,content:content,id:id},
            success:function(e){
                if(e==1){
                    layer.alert('回复成功', {
                        skin: 'layui-layer-molv' //样式类名
                        ,closeBtn: 0
                      }, function(){
                          window.location.reload(); 
                      });
                   
                   
                }else if(e==2){
                    layer.msg('请填写回复内容');
                }else{
                    layer.alert('回复失败', {
                        skin: 'layui-layer-molv' //样式类名
                        ,closeBtn: 0
                      }, function(){
                          window.location.reload(); 
                      });
                }
            }
        })
    }
    function sou(){
        var class_type = $('#class_type').val();
        location.href="__APP__/Admin/Baoming/index/is_pay/"+class_type+".html";
    }
</script>
</body>
</html>
